package org.vectrics.user;

import java.util.Comparator;

public class PersonMatchScoreComparator implements Comparator {

	public PersonMatchScoreComparator() {
		super();
	}

	public int compare(Object arg0, Object arg1) {
		PersonMatch personMatch0 = (PersonMatch)arg0;
		PersonMatch personMatch1 = (PersonMatch)arg1;
		
		// Highest score first
		int result = personMatch1.getScore().compareTo(personMatch0.getScore());
		
		if (result == 0) {
			result = personMatch0.getName().compareTo(personMatch1.getName());
		}
		return(result);
	}

}
